const usePage = (size = 10) => {
  const page = ref({
    pageSize: size,
    pageNum: 1,
  });
  watch(
    () => page.value.pageSize,
    () => {
      page.value.pageNum = 1;
    }
  );
  const total = ref(0);

  const resetPage = () => {
    page.value = {
      ...page.value,
      pageNum: 1,
    };
  };

  return {
    page,
    total,
    resetPage,
  };
};

export default usePage;
